#!/bin/bash

for file in $(git diff --cached --name-only --diff-filter=ACM | grep -e '\.py$')
do
  flake8 $file
  if [ $? != 0 ]; then
        echo "flake8 failed!"
        exit 1
   fi
done
exit 0